package com.ccBatis.sqlSession;

import com.ccBatis.exexutor.Executor;
import com.ccBatis.exexutor.SimpleExecutor;
import com.ccBatis.pojo.Configuration;

public class DefaultSqlSessionFactory implements SqlSessionFactory{
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {

        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        // 创建执行器对象
        Executor simpleExecutor = new SimpleExecutor();
        // 生产sqlSession
        return new DefaultSqlSession(configuration,simpleExecutor);
    }
}
